package com.graphsql.gamesdk;

import com.graphsql.gamesdk.callback.LoginCallback;
import com.graphsql.gamesdk.dialog.LoginDialog;
import com.graphsql.gamesdk.util.LogDebugger;
import com.graphsql.gamesdk.util.ResourceUtil;

import android.app.Activity;


public class Graphsql {
	/**
	 * Show login UI. Callback will happen when the player login success or not.
	 * 
	 * @param _context
	 *            Activity
	 * @param _callback
	 *            LoginCallback object. Please see LoginCallback object.
	 * @see LoginCallback
	 */
	public static void gs_loginView(final Activity _act, final LoginCallback _callback) {
		LogDebugger.println("Graphsql.gs_loginView()");
		_act.runOnUiThread(new Runnable() {
			public void run() {
				LoginDialog dialog = new LoginDialog(_act,
						ResourceUtil.getStyleId(_act,"gs_style_dialog_login"), 
						0,true,_callback);
				LoginDialog.hasShowDialog = false;
				dialog.show();
			}
		});
	}
}
